package com.pruebas.physics.rotatingcube;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.MotionEvent;


public class RotatingCubeSurfaceView extends GLSurfaceView {
	
	//private final float TOUCH_SCALE_FACTOR = 180.0f / 320;
    private RotatingCubeRenderer mRenderer;
    //private float mPreviousX;
    //private float mPreviousY;
          
    public RotatingCubeSurfaceView(Context context){
        super(context);
        // set the mRenderer member
        mRenderer = new RotatingCubeRenderer();
        setRenderer(mRenderer);
        
        // Render the view only when there is a change
        setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
    }
    
    /*@Override
    public boolean onTouchEvent(MotionEvent e) {
    	float x = e.getX();
		float y = e.getY();
		
    	switch(e.getAction()){
			case MotionEvent.ACTION_DOWN:
				setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
				mRenderer.stopTime();
				if(!mRenderer.isTouchingTheBall(x, y)){
					mRenderer.resumeTime();
					setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
				}			
				break;
			case MotionEvent.ACTION_UP:
				mRenderer.resumeTime();
				setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
				break;
			case MotionEvent.ACTION_MOVE:
				if(mRenderer.isTimeStopped()){
					mRenderer.setBallPosition(x, y);
					requestRender();
				}
				break;
		}
    	return true;
    }*/
}
